package com.table;

import java.io.IOException;

import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.ProcessAction;

import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.util.bridges.mvc.MVCPortlet;

/**
 * Portlet implementation class NewPortlet
 */
public class tablePortlet extends MVCPortlet {
	@ProcessAction(name = "login")
	public void login(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException {
		String mssv = ParamUtil.getString(actionRequest, "mssv");
		String pass = ParamUtil.getString(actionRequest, "password");
		String url = "";
		if (mssv.equals("admin") && pass.equals("admin")) {
			url = "/view.jsp";
		} else {
			url = "/view.jsp";
		}
		actionRequest.setAttribute(mssv, pass);
		actionResponse.sendRedirect(url);
	}

}
